
<%= select_f f, :architecture_id, accessible_resource(f.object, :architecture), :id, :to_label, {:include_blank => true},
    {:'data-url' => method_path('architecture_selected'), :'data-type' =>  controller_name.singularize == 'compute_resources_vm' ? 'host' : controller_name.singularize,
    :help_inline => :indicator, :required => true} %>

<span id="os_select">
  <%= render 'common/os_selection/architecture', :item => @host %>
</span>

<div id='provisioning_method' <%= display? (@host.capabilities.size < 2)  %> >
  <%= field(f, :provision_method, :label => _('Provisioning Method'), :required => true, :size => 'col-md-10') do
    Host::Managed.provision_methods.sort_by { |name, friendly_name| name }.collect do |provision_method, friendly_name|
      radio_button_f(f, :provision_method, :value=>provision_method, :text=> _(friendly_name), :disabled => !@host.new_record?)
    end.join(' ').html_safe
  end %>
</div>

<% Host::Managed.provision_methods.sort_by { |name, friendly_name| name }.each do |provision_method, friendly_name| %>
  <% if provision_method_partial_exist?(provision_method, 'form') %>
    <%= render provision_method_partial(provision_method, 'form'), :f => f, :host => @host %>
  <% end %>
<% end %>

<div id='root_password'>
  <%
    pass_keep_value = %w[clone create update].include?(action_name) && @host.root_pass_changed?
    unset_value = %w[edit update].include?(action_name) && !@host.root_pass_changed?
  %>
  <%= password_f f, :root_pass, :required => true,
                    :unset => unset_value,
                    :keep_value => pass_keep_value,
                    :placeholder => (@host.root_pass.empty?) ? nil : "**********",
                    :help_inline => _("Password must be 8 characters or more.") + ((@host.root_pass_source.present?) ? " " + _("The password is currently set by %s.") % _(@host.root_pass_source) : "") %>
</div>
<!-- this section is used for displaying the provisioning scripts-->
<div class="form-group">
  <label class="col-xs-2 control-label"><%= _('Provisioning Templates') %></label>
  <div class="col-xs-10">
    <%= link_to_function icon_text("refresh", _("Resolve")), "template_info('#templates_info','#{template_used_hosts_url(:id => @host.id)}')", :class => "btn btn-default" %>
    <div class="help-block">
      <%= _("Display the templates that will be used to provision this host") %>
    </div>
  </div>
  <div id="templates_info" class="col-xs-offset-2 col-xs-8"> </div>
</div>
